<me:UIVKPOS
    x:Class="WPFExcelReport.TPFBVK03"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
    xmlns:UserControls="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Controls"
    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
     xmlns:me="clr-namespace:WPFExcelReport" 
    xmlns:VK="clr-namespace:WPFExcelReport;assembly=TVKKOPF"
    xmlns:KD="clr-namespace:WPFExcelReport;assembly=TKDSTAMM"  
    xmlns:MF="clr-namespace:WPFExcelReport;assembly=TICC_MKRF"
     xmlns:GS="clr-namespace:WPFExcelReport;assembly=TGSDAT"
     xmlns:MU="clr-namespace:WPFExcelReport;assembly=TABAUFM"
     xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"
       xmlns:VF="clr-namespace:WPFExcelReport;assembly=TVAFARBEN" 
     xmlns:WFS="clr-namespace:WPFExcelReport;assembly=TICC_WFEVENTS"  
     xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
    xmlns:ChartEx="clr-namespace:WPFExcelReport.Chart;assembly=ITXVIEWS"
     xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL"  
    x:Name="TV"
    Loaded="Window_Loaded"
 >
    <me:UIVKPOS.Resources>
        <CollectionViewSource   x:Key="vwMaster" />
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PNumConverter  x:Key="pnum"/>
        <ucd:SubStrConverter x:Key="subs"/>
        <ucd:DateYR x:Key="yr"/>
        <ucd:DateNYR x:Key="nyr"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:BooleanToVisibilityConverter x:Key="bv"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:SDKEYCONV x:Key="sd"/>
    </me:UIVKPOS.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
        </Grid.RowDefinitions>
     
        <Grid Grid.Row="1" Visibility="{Binding IsGD,ElementName=TV,Converter={StaticResource nbv}}">
            <Grid.RowDefinitions>
                <RowDefinition   Height="Auto" />
                <RowDefinition   Height="1*" />
                <RowDefinition   Height="Auto" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition  Width="1*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <StackPanel Grid.Row="0" Grid.Column="0" > 
                <WrapPanel Visibility="Collapsed">
                    <me:TSACHBE SACHBE="{Binding SACHBE,ElementName=TV}"  />
                    <me:TYARNTYP YARNTYP="{Binding YARNTYP,ElementName=TV}"  />
                    <GS:TYNE YNE="{Binding YNE,ElementName=TV}"  />
                    <MU:TYSPPART KDPARTIE="{Binding SPINLOT,ElementName=TV}"  />
                    <me:TKDKOMM KDKOMM="{Binding KDKOMM,ElementName=TV}"  />
                    <VK:TBESTNR BESTNR="{Binding BESTNR,ElementName=TV}"  />
                    <KD:TSKD02   KUNDNR="{Binding KUNDNR,ElementName=TV}"  />
                </WrapPanel>
                <WrapPanel>
                    <WFS:TBTNEXE CMD="AB50COMBINE" DLL="TABPOS" STWNW="MainWindow"
                                 KEY="{Binding KEY,ElementName=TV}"
                                 INFO="合投" IsInfo="True"  Margin="10,0,0,0" Height="20"
                                 />
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=销售单}}"/>
                        <ex:TXT72  KeyUp="Query_KeyUp" MaxLength="2" Grid.Column="1" Text="{Binding KRS,ElementName=TV}" CharacterCasing="Upper" Width="40"/>
                        <ex:TXT72 PRE="" IsAutoClear="True" KeyUp="Query_KeyUp" MaxLength="6" Grid.Column="2" Text="{Binding LFD,ElementName=TV}" Width="80"/>
                    </Grid>
                    <SD:K8872 KEY="{Binding QCOND,ElementName=TV}"
                              IsCombo="False"
                        />
                    <Grid Margin="20,0,0,0" Visibility="Collapsed">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=已启动复板:}}"></TextBlock>
                        <CheckBox   Grid.Column="1" Margin="10,0,0,0" IsChecked="{Binding IsFB,ElementName=TV}" ></CheckBox>
                    </Grid>
                    <Grid Margin="20,0,0,0" Visibility="Collapsed">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=复板完成:}}"></TextBlock>
                        <CheckBox   Grid.Column="1" Margin="10,0,0,0" IsChecked="{Binding IsFBEnd,ElementName=TV}" ></CheckBox>
                    </Grid>
                    <Grid Margin="20,0,0,0" Visibility="Collapsed">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=已投料:}}"></TextBlock>
                        <CheckBox   Grid.Column="1" Margin="10,0,0,0" IsChecked="{Binding IsFFEnd,ElementName=TV}" ></CheckBox>
                    </Grid>
                    <Grid Margin="20,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=批号:}}"></TextBlock>
                        <ex:TXT72 IsAutoEnter="False" KeyUp="Query_KeyUp" MaxLength="10" Grid.Column="1" Text="{Binding SPINLOT,ElementName=TV}" CharacterCasing="Upper" Width="100"/>
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=交期晚于}}"/>
                        <TextBox Grid.Column="1" Text="{Binding LIEFTERM}" Width="100"/>
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Button Grid.Column="0" Height="20"  Width="24" Margin="20,0,0,0"   IsEnabled="True" Click="QueryCommand">
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                            </Button.Background>
                        </Button>
                    </Grid>
                    <Button Grid.Column="0"  Margin="20,0,0,0"   
                        Click="QueryTDPlanCommand">
                        <Button.Content>
                            <WrapPanel>
                                <TextBlock Text="{Binding Source={Localization:Translate Word=生产开单}}"/>
                                <ex:NumericBox Text="{Binding DTSTART,ElementName=TV}" Width="80"/>
                                <ex:NumericBox Text="{Binding DTEND,ElementName=TV}" Width="80"/>
                            </WrapPanel>
                        </Button.Content>
                    </Button>
                </WrapPanel>               
                <Grid VerticalAlignment="Top" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <VF:TSVA10 Name="cVA10" ARTST="{Binding ARTST,ElementName=TV}"
                               ORDERNUM="{Binding VART,ElementName=TV}"
                           dwVF="{Binding dwVF,ElementName=TV}"   
                           Width="Auto" MinWidth="200" />
                </Grid>
                <WrapPanel Visibility="{Binding IsCondOnly,ElementName=TV,Converter={StaticResource bv}}">
                    <Button Margin="20,0,0,0" Content="加载下一页" Click="QueryNextCommand"/>
                    <TextBlock Text="已加载页"/>
                    <TextBlock  Margin="20,0,0,0"  Text="{Binding PAGEN,ElementName=TV}"/>
                    <TextBlock  Margin="20,0,0,0" Text="{Binding INFO,ElementName=TV}"/>
                </WrapPanel>
            </StackPanel>
            <DataGrid Grid.Row="1" 
                  Grid.Column="0" Grid.ColumnSpan="2"
                AutoGenerateColumns="False" 
                  EnableRowVirtualization="False" 
                  Name="dlgMaster" 
                  ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster }}" 
                  HeadersVisibility="Column"  CanUserReorderColumns="True" CanUserResizeRows="True"  
                       RowDetailsVisibilityMode="VisibleWhenSelected" Width="Auto" Height="Auto" EnableColumnVirtualization="True" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=VKPEXART,Converter={StaticResource ResourceKey=subs},ConverterParameter=2+8}" 
                                        Header="{Binding Source={Localization:Translate Word=复板状态}}" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=ABKARTSB,Converter={StaticResource ResourceKey=gb2312}}" 
                                        Header="{Binding Source={Localization:Translate Word=合投}}" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=P01,Converter={StaticResource sd},ConverterParameter=9315}" Header="{Binding Source={Localization:Translate Word=梳理}}" Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=ABAUF}" Header="{Binding Source={Localization:Translate Word=生产单}}" Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=VKPWVTERM,Converter={StaticResource nyr}}" Header="{Binding Source={Localization:Translate Word=接单日期}}" Width="Auto" />                    
                    <DataGridTextColumn Binding="{Binding Path=VKPEXAUFLFD,Converter={StaticResource pnum}}" Header="{Binding Source={Localization:Translate Word=复板单}}" Width="60" />
                     <DataGridTextColumn Binding="{Binding Path=VKPAUFKRS}" Header="" Width="Auto" MinWidth="24" />
                    <DataGridTextColumn Binding="{Binding Path=VKPAUFLFD,Converter={StaticResource pnum}}" Header="{Binding Source={Localization:Translate Word=销售单}}" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=VKPAUFPOS,Converter={StaticResource pnum}}" Header=" " Width="Auto"  />
                    <DataGridTextColumn Binding="{Binding Path=ABACOLORREF,Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=批号}}"   Width="Auto"  MinWidth="40"/>                  
                    <DataGridTextColumn Binding="{Binding Path=VKPFARBE, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=色号}}" Width="Auto"   />
                    <DataGridTextColumn Binding="{Binding Path=VKPMENGE1, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=订单量}}" Width="Auto" />                 
                    <DataGridTextColumn Binding="{Binding Path=VKPLIEFTERM,Converter={StaticResource nyr}}" Header="{Binding Source={Localization:Translate Word=交期}}" Width="Auto" MinWidth="30" />                  
                    <DataGridTextColumn Binding="{Binding Path=KDKNAME,Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=客户}}"   Width="auto"  MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPKDFARBNR, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=客人色号}}" Width="auto" MinWidth="100"/>                  
                    <DataGridTextColumn Binding="{Binding Path=STRENGTH, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=强力标准}}"  Width="auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=TWIST, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=捻度标准}}"  Width="auto" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=COLORSTD, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=颜色标准}}"  Width="auto" MinWidth="24"/>
                    <DataGridTextColumn Binding="{Binding Path=YARNTYP}" Header="{Binding Source={Localization:Translate Word=纱型}}"  Width="Auto" MinWidth="24"/>
                    <DataGridTextColumn Binding="{Binding Path=YNE}" Header="{Binding Source={Localization:Translate Word=纱支}}"  Width="Auto" MinWidth="24"/>
                    <DataGridTextColumn Binding="{Binding Path=VAAPRGR}" Header="{Binding Source={Localization:Translate Word=用途}}"   Width="Auto"  MinWidth="24"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPNEUDAT,Converter={StaticResource yr}}" Header="{Binding Source={Localization:Translate Word=创建日期}}" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=VKPNEUBEN}" Header="{Binding Source={Localization:Translate Word=跟单}}" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=VKPSACHBE}" Header="{Binding Source={Localization:Translate Word=负责人}}" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=VKPART}" Header="{Binding Source={Localization:Translate Word=纱线}}" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=VKCOM, Converter={StaticResource ResourceKey=gb2312}}" Header="{Binding Source={Localization:Translate Word=成份}}"   Width="Auto"  MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPRESERV, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=预留}}" Width="Auto"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPZUGET, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=留位}}" Width="Auto" />
                    <DataGridTextColumn Binding="{Binding Path=VKPFREIGE, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=发货}}" Width="Auto"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPVERS, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=走货}}" Width="Auto"/>
                    <DataGridTextColumn Binding="{Binding Path=VKPFAKT, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=开票}}" Width="Auto"/>
                    <DataGridTextColumn Binding="{Binding Path=VKKBESTNR}" Header="{Binding Source={Localization:Translate Word=申购单号}}"   Width="Auto"  MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=VKKBESTNR}" Header="{Binding Source={Localization:Translate Word=合同号}}"  Width="Auto" MinWidth="40"/>
                </DataGrid.Columns>
            </DataGrid>
            <WrapPanel Grid.Row="2" >
                <TextBlock Text="{Binding TKEY1}"  Margin="10,0,0,0"></TextBlock>
                <TextBlock Text="{Binding SUM1,Converter={StaticResource d100}}" Foreground="Red" Margin="10,0,0,0"></TextBlock> 
                <TextBlock Text="{Binding TCOUNT1}"   Margin="10,0,0,0"></TextBlock>
                <TextBlock Text="{Binding Counts}" Foreground="Red" Margin="20,0,0,0"></TextBlock>
            </WrapPanel>
        </Grid>
    </Grid>

</me:UIVKPOS>
